package com.spring.controller;

import com.spring.annotation.RpcReference;
import com.spring.demo.OrderParam;
import com.spring.demo.OrderService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author onlyone
 */
@RestController
@RequestMapping("/test")
public class TestController {

    @RpcReference(serviceVersion = "2.0", timeout = 10_000)
    private OrderService orderService;


    @RequestMapping(value = "/create_order")
    public Long createOrder() {

        OrderParam orderParam = new OrderParam();
        orderParam.setBuyerId(100000L);
        orderParam.setSellerId(20000L);
        orderParam.setAmount(66.88);
        Long orderId = orderService.createOrder(orderParam);

        return orderId;
    }


}
